<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增维度对照')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-comp-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="na" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">校验类型：</label>
                <div class="col-sm-8">
                    <select name="sdCombCheckStyle" class="form-control m-b" th:with="type=${@baseSd.getItem('dim_comp_check_style')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">对照分类：</label>
                <div class="col-sm-8">
                    <select name="sdCompClass" class="form-control m-b" th:with="type=${@baseSd.getItem('dim_comp_class')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">源字段：</label>
                <div class="col-sm-8">
                    <select name="idPubfldSource" class="form-control m-b" th:with="type=${@pubfldService.findByFldPrefix('id_')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.idPubfld}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">目标字段：</label>
                <div class="col-sm-8">
                    <select name="idPubfldTar" class="form-control m-b" th:with="type=${@pubfldService.findByFldPrefix('id_')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.idPubfld}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="des" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "base/dim/comp"
        $("#form-comp-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-comp-add').serialize());
            }
        }
    </script>
</body>
</html>